from base.base import Base
from time import sleep
from selenium.webdriver.common.by import By
import logging
class SouSuoPage(Base):

    qiangguo = (By.XPATH,'//android.widget.FrameLayout[@content-desc="强国通"]/android.widget.RelativeLayout/android.widget.RelativeLayout')

    sousuokuang = (By.ID,'android:id/search_src_text')

    sousuoshuru = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.widget.RelativeLayout/android.widget.SearchView/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.EditText')

    dy  = 'new UiSelector().text("网络查找手机号:")'
    dy2 = (By.XPATH, '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.TextView')
    dy3 = (By.XPATH, '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.widget.RelativeLayout/android.widget.SearchView/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.EditText')



    def sousuoyewu(self,casename):

        logging.info("")
        self.loc_ele(self.qiangguo).click()
        sleep(5)

        self.loc_ele(self.sousuokuang).click()
        sleep(5)

        self.loc_ele(self.sousuoshuru).send_keys(casename)
        sleep(5)
